﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyNhanSu
{
    public partial class FormMain : Form
    {
        public FormMain()
        {
            InitializeComponent();
            //InitializeData();
        }


// ------------------------ He Thong ---------------------------------------------
        private void bt_informationmycompany_Click(object sender, EventArgs e)
        {
            doShowInformationMyCompany();
        }

        private void bt_exit_Click(object sender, EventArgs e)
        {
            doClose();
        }
// ------------------------ End He Thong ---------------------------------------------
// ------------------------ Chuc Nang ---------------------------------------------
        private void bt_listungvien_Click(object sender, EventArgs e)
        {
            //tabcontrol_main.TabPages[0].PageVisible = true;
            doCreateListUngVien();
        }
        private void bt_liststaff_Click(object sender, EventArgs e)
        {
            //tabcontrol_main.TabPages[1].PageVisible = true;
        }
        private void bt_hopdong_Click(object sender, EventArgs e)
        {
            //tabcontrol_main.TabPages[2].PageVisible = true;
        }
// ------------------------ End Chuc Nang ---------------------------------------------
// ------------------------ Help ---------------------------------------------
        private void bt_lienhe_Click(object sender, EventArgs e)
        {
            doCreateFormLienHe();
        }

        private void bt_registry_Click(object sender, EventArgs e)
        {
            doCreateFormRegistry();
        }
// ------------------------ End Help ---------------------------------------------
     

// ---------------------------- Phuong thuc chung -------------------------------------------------
        private void doCreateListUngVien()
        {
            for (int i = 0; i < tc_view.TabPages.Count; i++)
            {
                if (tc_view.TabPages[i].Name.Equals("tp_danhsachungvien"))
                    return;
            }            
            tc_view.TabPages.Add("tp_danhsachungvien", "Danh Sách Ứng Viên");
            nhungform(new FormRegistry());
        }

        private void nhungform(Form frm)
        {
            tc_view.Visible = true;
            frm.FormBorderStyle = FormBorderStyle.None;
            frm.TopLevel = false;
            frm.Visible = true;
            frm.Dock = DockStyle.Fill;
            tc_view.TabPages[tc_view.TabPages.Count-1].Controls.Add(frm);
        }
        private void doCreateFormLienHe()
        {
            FormInformationCompany informationcompany = new FormInformationCompany();
            informationcompany.Show();
        }

        private void doCreateFormRegistry()
        {
            FormRegistry registry = new FormRegistry();
            registry.Show();
        }

        private void doClose()
        {
            this.Close();
        }

        private void doShowInformationMyCompany()
        {
            FormInformationMyCompany informationmycompany = new FormInformationMyCompany();
            informationmycompany.Show();
        }
// -----------------------------------------------------------------------------------------------
    }
}